package com.demo.service;

import com.alibaba.fastjson.JSONObject;
import com.demo.Pojo.Books;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

//通过服务名找到对应的服务提供者
//@FeignClient(value = "SpringCloud-Provider1") //这个注释是为了防止和测试服务降级冲突，测试熔断需要取消注释
//@Service
public interface FeignBookService {

    @RequestMapping("book/queryBookById/{id}")
    Books queryById(@PathVariable("id") int id);

    @RequestMapping("/book/allBook")
    JSONObject queryAll();

}
